package com.ruoyi.system.domain;

import java.util.Date;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 题目管理对象 t_topic
 * 
 * @author ruoyi
 * @date 2023-01-12
 */

public class Topic extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 题目id */

    private Long topicId;

    /** 题库id */
    private Long poolId;

    /** 题库名称 */
    private String poolName;

    public String getPoolName() {
        return poolName;
    }

    public void setPoolName(String poolName) {
        this.poolName = poolName;
    }

    /** 题目 */
    @Excel(name = "题目")
    private String question;

    /** 答案 */
    @Excel(name = "答案")
    private String answer;

    /** 题目类型（1填空题 2填空题 3简答题） */
    @Excel(name = "题目类型", readConverterExp = "1=选择题,2=填空题,3=简答题")
    private String category;

    /** 最后一次答题状态（0正确 1错误） */
    private String lastDoneState;

    /** 最后一次答题时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date lastDoneTime;

    public void setTopicId(Long topicId) 
    {
        this.topicId = topicId;
    }

    public Long getTopicId() 
    {
        return topicId;
    }
    public void setPoolId(Long poolId) 
    {
        this.poolId = poolId;
    }

    public Long getPoolId() 
    {
        return poolId;
    }
    public void setQuestion(String question) 
    {
        this.question = question;
    }

    public String getQuestion() 
    {
        return question;
    }
    public void setAnswer(String answer) 
    {
        this.answer = answer;
    }

    public String getAnswer() 
    {
        return answer;
    }
    public void setCategory(String category) 
    {
        this.category = category;
    }

    public String getCategory() 
    {
        return category;
    }
    public void setLastDoneState(String lastDoneState) 
    {
        this.lastDoneState = lastDoneState;
    }

    public String getLastDoneState() 
    {
        return lastDoneState;
    }
    public void setLastDoneTime(Date lastDoneTime) 
    {
        this.lastDoneTime = lastDoneTime;
    }

    public Date getLastDoneTime() 
    {
        return lastDoneTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Topic topic = (Topic) o;
        return Objects.equals(topicId, topic.topicId) && Objects.equals(poolId, topic.poolId) && Objects.equals(poolName, topic.poolName) && Objects.equals(question, topic.question) && Objects.equals(answer, topic.answer) && Objects.equals(category, topic.category) && Objects.equals(lastDoneState, topic.lastDoneState) && Objects.equals(lastDoneTime, topic.lastDoneTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(topicId, poolId, poolName, question, answer, category, lastDoneState, lastDoneTime);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("topicId", getTopicId())
            .append("poolId", getPoolId())
            .append("poolName", getPoolName())
            .append("question", getQuestion())
            .append("answer", getAnswer())
            .append("category", getCategory())
            .append("lastDoneState", getLastDoneState())
            .append("lastDoneTime", getLastDoneTime())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
